#pragma once
#ifndef _KLAS_SHADERS_HPP_
#define _KLAS_SHADERS_HPP_

#include "../Library.hpp"
#include <string>
using std::string;

namespace klas
{
  namespace graphics
  {
    //! The shader class allows the GPU to be programmed.  Shader needs to be run in a ShaderProgram to work.
    /*! Shaders are extremely useful.  They allow the remapping of pixel coordinates ("vertex buffers") and pixel 
        colors ("fragment buffers") on the GPU.

        You can combine graphics::RenderToTexture, graphics::Shader, and graphics::ShaderProgram to create a powerful
        post-processing framework.

        When in OpenGL mode, the shaders are expected to be in GLSL.  See this article for an introduction to GLSL. 
        http://www.lighthouse3d.com/opengl/glsl/index.php?intro

        When in DirectX mode, the shaders are expected to be in HLSL.

        Long term, Cg support is also planned.  Due to the bad support on Intel / ATI cards, it has a low priority.
    */
    class Shader: public virtual library::Base
    {
    public:
      //! The type of shader.
      enum eShaderType { 
        VERTEX_SHADER,  //!< A vertex shader, used for transforming vertex locations. 
        FRAGMENT_SHADER //!< A fragment shader, used for transforming colors, lights, etc.
      };
  
      //! Shader dtor.
      virtual ~Shader() {}

      //! Create and compile a shader from a file, and a shadertype.
      /*! \param file The file to create the shader from.
          \param shaderType The type of shader.  Either VERTEX_SHADER or FRAGMENT_SHADER */
      virtual bool create(string file, eShaderType shaderType) = 0;

      //! Destroys the shader.
      virtual bool destroy() = 0;

    };
  }
}

#endif